﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using VelesPresentation;
using VelesDBCore;

namespace VelesUIWPF
{
    /// <summary>
    /// Логика взаимодействия для LoginWindow.xaml
    /// </summary>
    public partial class LoginWindow : Window,ISecurityView 
    {
        SecurityUserGroup userGroup;

        public LoginWindow(SecurityUserGroup userGroup)
        {
            this.userGroup = userGroup;
            InitializeComponent();
        }

        #region Члены ISecurityView

        public event VoidEventHandler UserLogon;

        public string UserPassword
        {
            get { return textBox2.Text; }
        }

        string ISecurityView.UserLogin
        {
            get { return textBox1.Text; }
        }

        public VelesDBCore.SecurityUserGroup UserGroup
        {
            get
            {
                return userGroup;
            }
            set
            {
                userGroup = value;
            }
        }

        #endregion

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (UserLogon != null) UserLogon();
        }
    }
}
